package cn.wisteria._collections;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * <p>
 * {@link Collections#reverse}：集合中元素反转API
 * </p>
 * @author: zhu.chen
 * @date: 2021/3/25
 * @version: v1.0.0
 */
public class CollectionsMain {

    public static void main(String[] args) {
        List<Integer> count = new ArrayList<>();
        count.add(4);
        count.add(5);
        count.add(1);
        count.add(2);
        count.add(3);
        // [4, 5, 1, 2, 3]
        System.out.println(count);
        //
        Collections.reverse(count);
        // [3, 2, 1, 5, 4]
        System.out.println(count);
    }

}
